from module.asr import audio_to_text
from module.llm import ask_llm
from module.tts import text_to_audio
from config.settings import OPENAI_API_KEY, AUDIO_INPUT_PATH, AUDIO_OUTPUT_PATH

def main():
    question = audio_to_text(AUDIO_INPUT_PATH)
    if not question:
        print("未能识别音频内容")
        return
    print(f"识别内容: {question}")
    answer = ask_llm(question, OPENAI_API_KEY)
    print(f"大模型回答: {answer}")
    text_to_audio(answer, AUDIO_OUTPUT_PATH)
    print(f"回答音频已保存到: {AUDIO_OUTPUT_PATH}")

if __name__ == "__main__":
    main() 